package com.example.disconf.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.example.disconf.service.AutoService;

/**
 * 定时输出配置修改
 */
public class DisconfDemoTask implements Runnable {

	protected static final Logger LOGGER = LoggerFactory
			.getLogger(DisconfDemoTask.class);

	private AutoService autoService;

	public DisconfDemoTask(AutoService simpleConfig) {
		this.autoService = simpleConfig;
	}

	public void run() {
		try {

			while (true) {
				Thread.sleep(5000);
				LOGGER.info("simple config ==> auto:{}, demo:{}, test:{} ",
						autoService.getAuto(), autoService.getDemo(),
						autoService.getTest());
			}

		} catch (Exception e) {
			LOGGER.error(e.toString(), e);
		}
	}
}